import request from '@/utils/request'
import defaultSettings from '@/settings'

// 消息配置维护查询
export const msgConfMaintainUrlConfig = {
  queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfMaintain/search`,
}

// 消息配置审核查询
export const msgConfApproveUrlConfig = {
  queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfApprove/search`,
}

// 查询可选择消息分组列表
export function getMsgGroupList(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/getMsgGroupList`,
    method: 'post',
    data,
  })
}

// 查询可选择监控事件列表
export function getMonitorConfList(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MonitorConfMaintain/getMonitorConfList`,
    method: 'post',
    data,
  })
}

// 消息配置新增提交
export function msgConfAdd(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfMaintain/save`,
    method: 'post',
    data,
  })
}

// 消息维护修改详情
export function msgConfDetail(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfMaintain/detail`,
    method: 'get',
    params: data,
  })
}

// 消息配置修改提交
export function msgConfUpdate(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfMaintain/updateSave`,
    method: 'post',
    data,
  })
}

// 消息配置维护删除
export function msgConfDelete(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfMaintain/delete`,
    method: 'post',
    data,
  })
}

// 消息配置审核详情
export function msgConfApproveDetail(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfApprove/detail`,
    method: 'get',
    params: data,
  })
}

// 消息配置审批通过
export function msgConfApprove(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfApprove/approve`,
    method: 'post',
    data,
  })
}

// 消息配置审批拒绝
export function msgConfReject(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgConfApprove/reject`,
    method: 'post',
    data,
  })
}

// 按事件编号获取事件名称
export function getEventTypeName(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MonitorConfMaintain/getEventTypeName`,
    method: 'get',
    params: data,
  })
}
